{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# 并查集的局限性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "iris = datasets.load_iris()\n",
    "X = iris.data[:,2:]\n",
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=2,\n            max_features=None, max_leaf_nodes=None,\n            min_impurity_decrease=0.0, min_impurity_split=None,\n            min_samples_leaf=1, min_samples_split=2,\n            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n            splitter='best')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree.tree import DecisionTreeClassifier\n",
    "\n",
    "tree_clf = DecisionTreeClassifier(max_depth=2, criterion='entropy')\n",
    "tree_clf.fit(X,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from playML.plot_utils import plot_decision_boundary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGx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VLrmbmb3m9mwmb2SdS1JmNkyM9tiZjvM7FUzuynrmuIys/lm9qKZvRzUfmfWNSVhZt1m9gsz+9usa2mUmf3GzH5pZtvNbCjrehplZgNm9qiZvWZmO83sE1nXFJeZ/Xbw+z75dcjMbs6snrJdczezTwGHgQfd/eKs62mUmS0Blrj7NjPrB7YCn3P3HRmXVlfwU8l97n7YzHqBZ4Gb3P35jEtriJn9R2AQWODu12RdTyPM7DfAoLsX8oeAzOwB4Bl3vzdI553i7iNZ19WoYGzLm8DH3f2NLGoo3Tt3d3+aSmKnkNx9r7tvCx6PAjup/ARw7nnF4eBpb/BVqHcPZrYUWAPcm3UtncbMTgM+RSV9h7t/UMTGHvg08H+zauxQwuZeJma2HFgJvJBtJfEFlzS2A8PAT929MLUH/jvwn4DwMP+icOApM9sajPsokvOAd4D/FVwWu9fM+rIuKqG1wENZFqDmnlNmdirwGHCzux/Kup643H3c3VdQ+UnmVWZWmEtjZnYNMOzuW7OupQm/5+6/S2WK69eCy5RF0QP8LvA9d18JHAH+c7YlNS64nPRZ4JEs61Bzz6HgevVjwA/c/fGs60ki+Of0FuDKrGtpwGrgs8F164eB3zezv8y2pMa4+5vBf4eBH1GZ6loUe4A9Vf/ae5RKsy+aq4Bt7r4vyyLU3HMmuCl5H7DT3b+VdT2NMLNFZjYQPD4Z+AzwWrZVxefut7j7UndfTuWf1T9z93+dcVmxmVlfcBOe4HLGFUBhUmPu/jaw28x+O1j6NJD7IEGEL5DxJRlo81TIdjCzh4DLgYVmtge43d3vy7aqhqwGvgT8Mrh2DXCru2/OsKa4lgAPBEmBLuCH7l64OGGBnQX8KPgohR7gr9z977ItqWFfB34QXNp4HfhqxvU0JPhL9TPAv828lrJFIUVERJdlRERKSc1dRKSE1NxFREpIzV1EpITU3EVESkjNXUSkhNTcRURK6P8DQvphtANyYsAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x109d5a080>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(tree_clf,axis=[0.5,7.5,0,3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 删除一条记录（样本）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_new = np.delete(X, 138, axis=0)\n",
    "y_new = np.delete(y, 138)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((149, 2), (149,))"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.shape(X_new), np.shape(y_new)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=2,\n            max_features=None, max_leaf_nodes=None,\n            min_impurity_decrease=0.0, min_impurity_split=None,\n            min_samples_leaf=1, min_samples_split=2,\n            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n            splitter='best')"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tree_clf2 = DecisionTreeClassifier(max_depth=2, criterion='entropy')\n",
    "tree_clf2.fit(X_new, y_new)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/seamonster/MachineLearningClassicAlgorithmEnv/lib/python3.6/site-packages/matplotlib/contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRA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NcZnZQjN7wcxeCmr/etY1JWFm3Wb2MzP726xraZSZ/crMfm5m28xsKOt6GmVmA2b2sJm9amY7zOzjWdcUl5l9KPh7n3ocNLMbM6unbNfczeyTwBhwn7tfkHU9jTKz5cByd99qZv3AFuCz7r4949LqCj6V3OfuY2bWCzwD3ODuz2VcWkPM7L8Ag8Bid78q63oaYWa/AgbdvZAfAjKze4Gn3f2uIJ13gruPZF1Xo4JlW94EPubub2RRQ+nO3N39KSqJnUJy993uvjV4PgrsoPIJ4NzzirFgszd4FOrswcxOB9YCd2VdS6cxsxOBT1JJ3+Hu7xexsQc+Bfy/rBo7lLC5l4mZrQQuBp7PtpL4gksa24Bh4MfuXpjaA38G/FcgvJh/UTjwhJltCZb7KJKzgLeB/x1cFrvLzPqyLiqhdcADWRag5p5TZrYIeAS40d0PZl1PXO4+4e4XUfkk8yozK8ylMTO7Chh29y1Z19KEX3f3j1JZxfUrwWXKougBPgr8ubtfDBwC/lu2JTUuuJz0GeChLOtQc8+h4Hr1I8D97v5o1vUkEfw6/SRwRda1NGA18JnguvWDwG+Y2V9lW1Jj3P3N4L/DwA+orOpaFLuAXVW/7T1MpdkXzZXAVnffm2URau45E9yUvBvY4e7fyrqeRpjZUjMbCJ4fD3waeDXbquJz95vc/XR3X0nl1+qfuPt/yLis2MysL7gJT3A543KgMKkxd98D7DSzDwVDnwJyHySI8HkyviQDbV4Vsh3M7AHgMmCJme0CbnX3u7OtqiGrgS8APw+uXQPc7O6bM6wpruXAvUFSoAv4vrsXLk5YYCcDPwi+SqEH+D/u/nfZltSw64H7g0sbrwNfyriehgQ/VD8N/KfMaylbFFJERHRZRkSklNTcRURKSM1dRKSE1NxFREpIzV1EpITU3EVESkjNXUSkhP4/pnAyl7ioPGwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x106452908>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(tree_clf2,axis=[0.5,7.5,0,3])\n",
    "plt.scatter(X[y==0,0],X[y==0,1])\n",
    "plt.scatter(X[y==1,0],X[y==1,1])\n",
    "plt.scatter(X[y==2,0],X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看到删除一条样本后，决策边界改动很大"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
